
export default {
  namespaced: true,
  // 专门存储当前 购物车中的公共数据
  state: {
    num: 20
  },
  mutations: {
    ADD_NUM (state, n) {
      state.num += n
    },
    REDUCE_NUM (state, n) {
      state.num -= n
    }
  },
  getters: {
    doubleNum (state) {
      return state.num * 2
    }
  }
}
